'use strict';

module.exports = appInfo => {
  return {
    middleware: ['tokenAuth'],
    keys: `${appInfo.name}_1492054139103_7031`,
    jwtSecret: 'jintouhui-secret',
    view: {
      defaultViewEngine: 'nunjucks',
      mapping: {
        '.tpl': 'nunjucks',
      },
    },
    mongoose: {
      url: 'mongodb://127.0.0.1:27017/egg',
      options: {
        promiseLibrary: require('bluebird'),
      },
    },
    security: {
      csrf: {
        enable: false,
      },
    },
    tokenAuth: {
      exclude: [/\/(login|register)(\/|$)/],
    },
  };
};
